Conversation
There was a problem hiding this comment.
Change the users parameter in your find to user or u, since it's just a single user object:
return data.users.find(u => u.id === id)
There was a problem hiding this comment.
Change the name of the find function parameter to reflect the fact that it's just a single product. See my comments below.
There was a problem hiding this comment.
You only need to pass in the data.
There was a problem hiding this comment.
Instead of calling your variable activeUser, call it currentUser. We haven't determined if it's actually an active user yet.
|
Comments in your code! Please seek help if needed! |
jcheroske
left a comment
There was a problem hiding this comment.
You're ready to move on. Please keep pushing up your changes as you work.
| const getProductById = (data, id) => { | ||
| if (data == null || data.products == null || id == null) { | ||
| return null | ||
| }else{ |
| const getUserById = (data, id) => { | ||
| if (data == null || id == null || data.users == null) { | ||
| return null | ||
| }else{ |
There was a problem hiding this comment.
You can drop this else too.
| const getActiveUsers = (data) => { | ||
| if (data == null || data.users == null) { | ||
| return null | ||
| } else { |
No description provided.